<template>
    <view class="components" @click.stop="navDetail">
        <view class="header">
            <view class="com_name">{{ dataDetail.fullname }}</view>
            <img v-if="isStar" class="icon" :src="`https://xunlantech.oss-cn-hangzhou.aliyuncs.com/source/static/image/${ dataDetail.collect == 1 ? 'instar' : 'star'}_icon.png`" />
            <img v-if="dataDetail.isopenim == 1" class="message_icon" src="https://xunlantech.oss-cn-hangzhou.aliyuncs.com/source/static/image/im-blue_icon.png" />
        </view>
        <view class="tips">
            <view class="tips_black" v-for="(item, index) in dataDetail.tally" :key="index">
                {{ item.name }}
            </view>
        </view>
        <view class="footer">
            <view style="width: 65%">
                <view class="title">区域</view>
                <view class="text">{{ dataDetail.province }}</view>
            </view>
            <view style="width: 35%">
                <view class="title">营收</view>
                <view class="text">{{ dataDetail.totalassets }}</view>
            </view>
            <view style="width: 100%">
                <view class="title">产业</view>
                <view class="text size_omit2">{{ dataDetail.firm_trade || '' }}</view>
            </view>
        </view>

    </view>
</template>

<script>
var app = getApp()
    export default {
        props: {
            dataDetail: {
                type: Object,
                default: null
            },
            isStar: {
                type: Boolean,
                default: false
            }
        },
        data() {
            return {

            }
        },
        methods: {
            navDetail() {
                this.$emit('onClick', this.dataDetail)
            }
        }
    }
</script>

<style scoped lang="scss">
.components view {
    margin: 10rpx 0;
}
.components {
    width: 100%;
    min-height: 200rpx;
    background: white;
    border-radius: 16rpx;
    margin-bottom: 12rpx;
    padding: 20rpx 16rpx;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    .icon {
        width: 40rpx;
        height: 40rpx;
    }
    .message_icon {
        width: 45rpx;
        height: 45rpx;
    }
    .header {
        width: 100%;
        height: 45rpx;
        display: flex;
        align-items: center;
        justify-content: space-between;
        .com_name {
            width: 85%;
            height: 45rpx;
            font-size: 32rpx;
            font-family: PingFangSC, PingFang SC;
            font-weight: bold;
            color: #494949;
            line-height: 45rpx;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }
    }
    .tips {
        width: 100%;
        height: 34rpx;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        .tips_black {
            font-size: 24rpx;
            font-family: PingFangSC, PingFang SC;
            font-weight: 400;
            color: #5162FD;
            line-height: 33rpx;
            padding: 2rpx 4rpx;
            box-sizing: border-box;
            margin-right: 10rpx;
            border-radius: 12rpx;
            border: 2rpx solid #e2e2e2;
        }
    }
    .footer {
        width: 100%;
        height: auto;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    .footer view {
        display: flex;
        margin: 2rpx 0;
        .title {
            font-size: 24rpx;
            font-family: PingFangSC, PingFang SC;
            font-weight: 400;
            color: #9B9B9B;
            line-height: 33rpx;
            margin-right: 22rpx;
            width: 50rpx;
        }
        .text {
            width: 90%;
            flex: 1;
            font-size: 24rpx;
            font-family: PingFangSC, PingFang SC;
            font-weight: 400;
            color: #494949;
            line-height: 33rpx;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
    }
}

</style>
